package com.ruoyi.system.service.impl;


import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TbServiceStation;
import com.ruoyi.system.mapper.TbServiceStationMapper;
import com.ruoyi.system.service.ITbServiceStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 站Service业务层处理
 * 
 * @author admin
 * @date 2022-05-06
 */
@Service
public class TbServiceStationServiceImpl implements ITbServiceStationService
{
    @Autowired
    private TbServiceStationMapper tbServiceStationMapper;

    /**
     * 查询站
     * 
     * @param stationId 站主键
     * @return 站
     */
    @Override
    public TbServiceStation selectTbServiceStationByStationId(Integer stationId)
    {
        return tbServiceStationMapper.selectTbServiceStationByStationId(stationId);
    }

    /**
     * 查询站列表
     * 
     * @param tbServiceStation 站
     * @return 站
     */
    @Override
    public List<TbServiceStation> selectTbServiceStationList(TbServiceStation tbServiceStation)
    {
        return tbServiceStationMapper.selectTbServiceStationList(tbServiceStation);
    }

    /**
     * 新增站
     * 
     * @param tbServiceStation 站
     * @return 结果
     */
    @Override
    public int insertTbServiceStation(TbServiceStation tbServiceStation)
    {
        tbServiceStation.setCreateTime(DateUtils.getNowDate());
        return tbServiceStationMapper.insertTbServiceStation(tbServiceStation);
    }

    /**
     * 修改站
     * 
     * @param tbServiceStation 站
     * @return 结果
     */
    @Override
    public int updateTbServiceStation(TbServiceStation tbServiceStation)
    {
        return tbServiceStationMapper.updateTbServiceStation(tbServiceStation);
    }

    /**
     * 批量删除站
     * 
     * @param stationIds 需要删除的站主键
     * @return 结果
     */
    @Override
    public int deleteTbServiceStationByStationIds(String stationIds)
    {
        return tbServiceStationMapper.deleteTbServiceStationByStationIds(Convert.toStrArray(stationIds));
    }

    /**
     * 删除站信息
     * 
     * @param stationId 站主键
     * @return 结果
     */
    @Override
    public int deleteTbServiceStationByStationId(Integer stationId)
    {
        return tbServiceStationMapper.deleteTbServiceStationByStationId(stationId);
    }
}
